home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Tools - Objects / MacApp / MacApp 3.0a2 / CPlusIncludes / Controls.h < prev    next >
Text File  |  1991-05-01  |  6KB  |  214 lines

  1. /************************************************************
  2.  
  3. Created: Sunday, January 6, 1991 at 9:03 PM
  4.     Controls.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.         Copyright Apple Computer, Inc. 1985-1990
  9.         All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __CONTROLS__
  15. #define __CONTROLS__
  16.  
  17. #ifndef __GEOMETRY__
  18. #include <Geometry.h>
  19. #endif
  20.  
  21. #ifndef __QUICKDRAW__
  22. #include <Quickdraw.h>
  23. #endif
  24.  
  25.  
  26. enum {
  27.  
  28.     pushButProc = 0,
  29.     checkBoxProc = 1,
  30.     radioButProc = 2,
  31.     useWFont = 8,
  32.     scrollBarProc = 16,
  33.     inButton = 10,
  34.     inCheckBox = 11,
  35.     inUpButton = 20,
  36.     inDownButton = 21,
  37.     inPageUp = 22,
  38.     inPageDown = 23,
  39.     inThumb = 129,
  40.  
  41.     popupMenuProc = 1008,   /* 63 * 16 */
  42.     inLabel = 1,
  43.     inMenu = 2,
  44.     inTriangle = 4
  45. };
  46.  
  47. enum {    popupFixedWidth        = 1 << 0,    popupReserved            = 1 << 1,    popupUseAddResMenu    = 1 << 2,
  48.         popupUseWFont        = 1 << 3};
  49.  
  50. enum {    popupTitleBold        = 1 << 8,    popupTitleItalic    = 1 << 9,    popupTitleUnderline    = 1 << 10,
  51.         popupTitleOutline    = 1 << 11,    popupTitleShadow    = 1 << 12,    popupTitleCondense    = 1 << 13,
  52.         popupTitleExtend    = 1 << 14,    popupTitleNoStyle    = 1 << 15};
  53.  
  54.  
  55. enum {
  56.  
  57.     popupTitleLeftJust = 0x00000000,
  58.     popupTitleCenterJust = 0x00000001,
  59.     popupTitleRightJust = 0x000000FF,
  60.  
  61. /*
  62. axis constraints for DragGrayRgn call*/
  63.     noConstraint = 0,
  64.     hAxisOnly = 1,
  65.     vAxisOnly = 2,
  66.  
  67. /*
  68. control messages*/
  69.     drawCntl = 0,
  70.     testCntl = 1,
  71.     calcCRgns = 2,
  72.     initCntl = 3,
  73.     dispCntl = 4,
  74.     posCntl = 5,
  75.     thumbCntl = 6,
  76.     dragCntl = 7,
  77.     autoTrack = 8,
  78.     calcCntlRgn = 10,
  79.     calcThumbRgn = 11,
  80.  
  81.     cFrameColor = 0,
  82.     cBodyColor = 1,
  83.     cTextColor = 2
  84. };
  85. enum {
  86.     cThumbColor = 3
  87. };
  88.  
  89. struct ControlRecord {
  90.     struct ControlRecord **nextControl;
  91.     WindowPtr contrlOwner;
  92.     Rect contrlRect;
  93.     unsigned char contrlVis;
  94.     unsigned char contrlHilite;
  95.     short contrlValue;
  96.     short contrlMin;
  97.     short contrlMax;
  98.     Handle contrlDefProc;
  99.     Handle contrlData;
  100.     ProcPtr contrlAction;
  101.     long contrlRfCon;
  102.     Str255 contrlTitle;
  103. };
  104.  
  105. typedef ControlRecord *ControlPtr, **ControlHandle;
  106.  
  107. struct CtlCTab {
  108.     long ccSeed;            /*reserved*/
  109.     short ccRider;          /*see what you have done - reserved*/
  110.     short ctSize;           /*usually 3 for controls*/
  111.     ColorSpec ctTable[4];
  112. };
  113.  
  114. typedef struct CtlCTab CtlCTab;
  115. typedef CtlCTab *CCTabPtr, **CCTabHandle;
  116.  
  117. struct AuxCtlRec {
  118.     Handle acNext;          /*handle to next AuxCtlRec*/
  119.     ControlHandle acOwner;  /*handle for aux record's control*/
  120.     CCTabHandle acCTable;   /*color table for this control*/
  121.     short acFlags;          /*misc flag byte*/
  122.     long acReserved;        /*reserved for use by Apple*/
  123.     long acRefCon;          /*for use by application*/
  124. };
  125.  
  126. typedef struct AuxCtlRec AuxCtlRec;
  127. typedef AuxCtlRec *AuxCtlPtr, **AuxCtlHandle;
  128.  
  129.  
  130. #ifdef __cplusplus
  131. extern "C" {
  132. #endif
  133. pascal ControlHandle NewControl(WindowPtr theWindow,const Rect& boundsRect,
  134.     ConstStr255Param title,Boolean visible,short value,short min,short max,
  135.     short procID,long refCon)
  136.     = 0xA954; 
  137. pascal void SetCTitle(ControlHandle theControl,ConstStr255Param title)
  138.     = 0xA95F; 
  139. pascal void GetCTitle(ControlHandle theControl,Str255& title)
  140.     = 0xA95E; 
  141. pascal ControlHandle GetNewControl(short controlID,WindowPtr owner)
  142.     = 0xA9BE; 
  143. pascal void DisposeControl(ControlHandle theControl)
  144.     = 0xA955; 
  145. pascal void KillControls(WindowPtr theWindow)
  146.     = 0xA956; 
  147. pascal void HideControl(ControlHandle theControl)
  148.     = 0xA958; 
  149. pascal void ShowControl(ControlHandle theControl)
  150.     = 0xA957; 
  151. pascal void DrawControls(WindowPtr theWindow)
  152.     = 0xA969; 
  153. pascal void Draw1Control(ControlHandle theControl)
  154.     = 0xA96D; 
  155. pascal void HiliteControl(ControlHandle theControl,short hiliteState)
  156.     = 0xA95D; 
  157. pascal void UpdtControl(WindowPtr theWindow,RgnHandle updateRgn)
  158.     = 0xA953; 
  159. pascal void UpdateControls(WindowPtr theWindow,RgnHandle updateRgn)
  160.     = 0xA953; 
  161. pascal void MoveControl(ControlHandle theControl,short h,short v)
  162.     = 0xA959; 
  163. pascal void SizeControl(ControlHandle theControl,short w,short h)
  164.     = 0xA95C; 
  165. pascal void SetCtlValue(ControlHandle theControl,short theValue)
  166.     = 0xA963; 
  167. pascal short GetCtlValue(ControlHandle theControl)
  168.     = 0xA960; 
  169. pascal void SetCtlMin(ControlHandle theControl,short minValue)
  170.     = 0xA964; 
  171. pascal short GetCtlMin(ControlHandle theControl)
  172.     = 0xA961; 
  173. pascal void SetCtlMax(ControlHandle theControl,short maxValue)
  174.     = 0xA965; 
  175. pascal short GetCtlMax(ControlHandle theControl)
  176.     = 0xA962; 
  177. pascal void SetCRefCon(ControlHandle theControl,long data)
  178.     = 0xA95B; 
  179. pascal long GetCRefCon(ControlHandle theControl)
  180.     = 0xA95A; 
  181. pascal void SetCtlAction(ControlHandle theControl,ProcPtr actionProc)
  182.     = 0xA96B; 
  183. pascal ProcPtr GetCtlAction(ControlHandle theControl)
  184.     = 0xA96A; 
  185. pascal void DragControl(ControlHandle theControl,Point startPt,const Rect& limitRect,
  186.     const Rect& slopRect,short axis)
  187.     = 0xA967; 
  188. pascal short TestControl(ControlHandle theControl,Point thePt)
  189.     = 0xA966; 
  190. pascal short TrackControl(ControlHandle theControl,Point thePoint,ProcPtr actionProc)
  191.     = 0xA968; 
  192. pascal short FindControl(Point thePoint,WindowPtr theWindow,ControlHandle& theControl)
  193.     = 0xA96C; 
  194. pascal void SetCtlColor(ControlHandle theControl,CCTabHandle newColorTable)
  195.     = 0xAA43; 
  196. pascal Boolean GetAuxCtl(ControlHandle theControl,AuxCtlHandle& acHndl)
  197.     = 0xAA44; 
  198. pascal short GetCVariant(ControlHandle theControl)
  199.     = 0xA809; 
  200. void dragcontrol(ControlHandle theControl,Point *startPt,const Rect *limitRect,
  201.     const Rect *slopRect,short axis); 
  202. ControlHandle newcontrol(WindowPtr theWindow,const Rect *boundsRect,char *title,
  203.     Boolean visible,short value,short min,short max,short procID,long refCon); 
  204. short findcontrol(Point *thePoint,WindowPtr theWindow,ControlHandle *theControl); 
  205. void getctitle(ControlHandle theControl,char *title); 
  206. void setctitle(ControlHandle theControl,char *title); 
  207. short trackcontrol(ControlHandle theControl,Point *thePoint,ProcPtr actionProc); 
  208. short testcontrol(ControlHandle theControl,Point *thePt); 
  209. #ifdef __cplusplus
  210. }
  211. #endif
  212.  
  213. #endif
  214.